﻿using System;
using System.Data;
using System.IO;
using System.Text;

namespace WindowsFormsApplication9
{
    class Class1
    {
        #region 用户表
        public static DataTable getLoginTable()
        {
            DataTable dt = new DataTable("Users");
            #region Manager表结构
            DataColumn dc1 = new DataColumn("Id", Type.GetType("System.Int16"));
            DataColumn dc2 = new DataColumn("Username", Type.GetType("System.String"));
            DataColumn dc3 = new DataColumn("Password", Type.GetType("System.String"));
            dt.Columns.Add(dc1);
            dt.Columns.Add(dc2);
            dt.Columns.Add(dc3);
            #endregion
            #region 具体数据
            DataSet ds = Data.ExecuteDataSet("select * from Users");
            dt = ds.Tables[0];

            #endregion
            return dt;
        }
        #endregion

        #region Data表
        public static DataTable getDataTable()
        {
            DataTable dt = new DataTable("Articles");
            #region Manager表结构
            DataColumn dc1 = new DataColumn("Id", Type.GetType("System.Int16"));
            DataColumn dc2 = new DataColumn("Title", Type.GetType("System.String"));
            DataColumn dc3 = new DataColumn("CreatedTime", Type.GetType("System.String"));
            DataColumn dc4 = new DataColumn("Author", Type.GetType("System.String"));
            dt.Columns.Add(dc1);
            dt.Columns.Add(dc2);
            dt.Columns.Add(dc3);
            dt.Columns.Add(dc4);
            #endregion
            #region 具体数据
            DataSet ds = Data.ExecuteDataSet("select * from Articles");
            dt = ds.Tables[0];

            #endregion
            return dt;
        }
        #endregion
    }
}
